package com.bang.study.jvm.demo02;

/**
 * @ClassName: StackOverFlowError
 * @author: BANG
 * @Date: 2019/10/30 17:35
 * @Version: 1.0
 * @Modified By:
 * @Desc: 模拟栈溢出
 */
public class StackOverFlowError {

    private static long count = 0;

    public static void work() {
        System.out.println("第"+(count++)+"次执行Work");
        work();
    }

    /**
     * JVM参数
     * -XX:ThreadStackSize=1m -XX:+PrintGCDetails -Xloggc:stack-gc.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=./ -XX:+UseParNewGC -XX:+UseConcMarkSweepGC
     *
     * @param args
     */
    public static void main(String[] args) {
        work();
    }
}
